package cn.uestc.labhms.modules.hms.controller;

import cn.uestc.labhms.common.annotation.SysLog;
import cn.uestc.labhms.common.utils.R;
import cn.uestc.labhms.modules.hms.entity.Vo.TimeLineVo;
import cn.uestc.labhms.modules.hms.service.TimeLineService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author mtz
 */
@RestController
public class TimeLineController {
    @Autowired
    private TimeLineService timeLineService;

    @GetMapping("/get/time/line")
    @SysLog("查看时间轴信息")
    @RequiresPermissions("hms:time_line:list")
    public R getTimeLine(@RequestParam("patientId") Integer patientId) {
        List<TimeLineVo> timeLine = timeLineService.getTimeLine(patientId);
        return R.ok().put("data", timeLine);
    }
}
